function C_dec = fp2dec(A)
    C_s = A(1);
    C_e = A(2:9);
    C_m = A(10:32);

    C_e_dec = binint2dec(C_e);
    C_e_dec = C_e_dec-127;
    
    C_m_dec = binfrac2dec(C_m);
    C_m_dec = C_m_dec+1;
    
    C_dec = (-1)^C_s*C_m_dec*2^C_e_dec;
end

function [t] = binfrac2dec(T)
    len_t = length(T);
    t = 0;
    for i = 1:len_t,
        t = t + T(i)*2^-(i);
    end 
end

function [t] = binint2dec(T)
    len_t = length(T);
    t = 0;
    for i = len_t:-1:1,
        t = t + T(i)*2^(len_t-i);
    end 
end